ScrolledWindow—Don’t req size for auto-hidden bars
authorDaniel Boles <dboles@src.gnome.org>
Fri, 17 Feb 2017 19:48:42 +0000 (19:48 +0000)
committerDaniel Boles <dboles@src.gnome.org>
Sun, 19 Feb 2017 17:03:44 +0000 (17:03 +0000)
commit901e5ff3a36b74b8ae4c19f4f20e84bc70b44913
tree0e21e27df3e78e2b2714a067996d93482ac2c764
parent7e201e19f9b3a024c8491981b5893aae86c704db
ScrolledWindow—Don’t req size for auto-hidden bars

POLICY_AUTOMATIC means scrollbars are only shown when needed, i.e. when
the size of the window is not large enough to show the entire child. So
when measuring the preferred size, such scrollbars should be ignored.

But measure() was adding size for bars for which policy_may_be_visible()
was TRUE, which it returns for POLICY_ALWAYS (good) & _AUTOMATIC (bad).
So we reserved space for child plus scrollbars, & because we have enough
space for the child, POLICY_AUTOMATIC hides the scrollbar, leaving the
extra reserved space empty at the right/bottom sides of the child. This
is very noticeable/inconvenient for non-overlay, automatic scrollbars.

Fix this by only requesting size for scrollbars that use POLICY_ALWAYS,
rather than basing the decision on policy_may_be_visible().

https://bugzilla.gnome.org/show_bug.cgi?id=778853
gtk/gtkscrolledwindow.c